package com.huatai.datadevelop.utils;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author hecai
 * @description: TODO
 * @date 2022/9/20 14:52
 * @Version 1.0
 */
public class InitHashMapUtil {

    /**
     * 设置默认请求头是json格式
     * @return
     */
    public static Map<String,String> InitHashMapJSON(){
        Map<String, String> headerMap = new ConcurrentHashMap<>();
        headerMap.put("Content-Type", "application/json");
        return headerMap;
    }

    /**
     * 拼接请求头的参数
     * @param contentType
     * @return
     */
    public static Map<String,String> InintCurrHashMap(String contentType){
        Map<String, String> headerMap = new ConcurrentHashMap<>();
        headerMap.put("Content-Type",contentType);
        return headerMap;
    }

    public static Map<String,String> InitHashMapForm(){
        Map<String, String> headerMap = new HashMap<>();
        headerMap.put("Content-Type", "application/x-www-form-urlencoded");
        return headerMap;
    }
}
